import {PropType} from '../utils/interface'

//引入一级路由
import LoginPage from '../views/LoginPage'//登录
import CategorysPage from '../views/CategorysPage'//奇趣分类
import BrandDetailPage from '../views/BrandDetailPage'//品牌直销
import TopicDetailPage from '../views/TopicDetailPage'//专题精选
import GoodsDetailPage from '../views/GoodsDetailPage'//商品详情
import CollectPage from '../views/CollectPage'//我的收藏
import AddressPage from '../views/AddressPage'//地址管理
import MainPage from '../views/MainPage'//二级路由管理

//引入二级路由
import Home from '../views/Main/Home'//首页
import Topic from '../views/Main/Topic'//专题
import Catelog from '../views/Main/Catelog'//分类
import Cart from '../views/Main/Cart'//购物车
import Mine from '../views/Main/Mine'//我的

let config = {
    routes: [
        {
            path: '/login',
            component: LoginPage
        },
        {
            path: '/categorys',
            component: CategorysPage
        },
        {
            path: '/brandDetail',
            component: BrandDetailPage
        },
        {
            path: '/topicDetail',
            component: TopicDetailPage
        },
        {
            path: '/goodsDetail',
            component: GoodsDetailPage
        },
        {
            path: '/collectPage',
            component: CollectPage
        },
        {
            path: '/addressPage',
            component: AddressPage
        },

        {
            path: '/main',
            component: MainPage,
            redirect: '/main/home',
            children: [
                {
                    path: '/main/home',
                    component: Home
                },
                {
                    path: '/main/topic',
                    component: Topic
                },
                {
                    path: '/main/catelog',
                    component: Catelog
                },
                {
                    path: '/main/cart',
                    component: Cart
                },
                {
                    path: '/main/mine',
                    component: Mine
                }
            ]
        }, {
            path: '*',
            redirect: '/main/home'
        }]
}

export default config as PropType